
//toast提醒
function makeToast(){
    window.webkit.messageHandlers.toastNotice
    .postMessage({
                 s:arguments[0]
                 });
};
//注册成功
function makeSignSuccess() {
    window.webkit.messageHandlers.registSuccess
    .postMessage({
                 username:arguments[0],
                 password:arguments[1]
                 });
};

function makeCallPay(){
    if (arguments.length == 5) {
        window.webkit.messageHandlers.pay
        .postMessage({
                     title:arguments[0],
                     type:arguments[1],
                     money:arguments[2],
                     time:arguments[3],
                     ios:arguments[4]
                     });
    } else if (arguments.length == 4) {
        window.webkit.messageHandlers.pay
        .postMessage({
                     title:arguments[0],
                     type:arguments[1],
                     money:arguments[2],
                     ios:arguments[3]
                     });
    } else {
        window.webkit.messageHandlers.error
        .postMessage('支付参数错误');
    }
};

function makeCallPayZJJZ(){
    if (arguments.length < 7) {
        window.webkit.messageHandlers.error
        .postMessage('专家讲座支付参数错误');
    } else {
        window.webkit.messageHandlers.payZJJZ
        .postMessage({
                     title:arguments[0],
                     type:arguments[1],
                     money:arguments[2],
                     time:arguments[3],
                     ios:arguments[4],
                     notice:arguments[5],
                     courseID:arguments[6]
                     });
    }
};

function makeGoAction() {
    if(arguments.length < 2){
        window.webkit.messageHandlers.error
        .postMessage('标签事件参数错误');
    }else{
        window.webkit.messageHandlers.goAction
        .postMessage({
                     id:arguments[0],
                     isRefresh:arguments[1]
                     });
    }
};

function makeCallUrl() {
    
    if(arguments.length < 1){
        window.webkit.messageHandlers.error
        .postMessage('打开链接参数错误');
    }else{
        window.webkit.messageHandlers.callURL
        .postMessage({ url:arguments[0] });
    }
    
};


function makeCallPayZNBK() {
    window.webkit.messageHandlers.payZnbk
    .postMessage({});
};



//打开客服
function makeKFServices(){
    window.webkit.messageHandlers.openKF
    .postMessage({ });
};

//function makeCallUrl(){
//    window.webkit.messageHandlers.callURLApp
//    .postMessage({url:arguments[0]});
//
//};

function makeSendCode(){
    window.webkit.messageHandlers.sendCode
    .postMessage({tel:arguments[0],type:arguments[1]})


}

//0元刷新
function makeRefresh(){
    window.webkit.messageHandlers.vippaysuccess
    .postMessage({ })
}

function makeGoHome(){
    
    window.webkit.messageHandlers.gohome
    .postMessage({ })
    
}

Android = new function() {
    
    this.goApp = makeGoApp;
    
    this.share = makeBaseShare;
    
    //toast提醒
    this.toast = makeToast;
    //注册成功
    this.signsuccess = makeSignSuccess;
    this.goAction = makeGoAction;
    this.callPay = makeCallPay;          // 普通支付;
    //打开客服功能
    this.kfServices = makeKFServices;
    //代开App功能
    this.callUrl = makeCallUrl; //打开外部App。
    
    this.sendCode = makeSendCode;
    
    //0元开通功能
    this.vippaysuccess = makeRefresh;
    
    //回到主页面
    this.gohome = makeGoHome;
    
};


